<template>
  <div>
    <One />
    <button @click="obj.count++">add:count1:{{ obj.count }}</button>
    <button @click="count++">add:count2:{{ count }}</button>
  </div>
</template>
<script>
import One from './components/One.vue';
export default {
  name: 'App',
  components: {
    One,
  },
  data() {
    return {
      obj: {
        count: 0,
      },
      count: 2,
    };
  },

  // provide配置项：向后代组件提供数据，这种书写方式是没有响应式的
  provide() {
    return {
      count: () => this.count,
    };
  },
};
</script>
<style></style>
